<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let a = 20;
        let b = 30;
        let c = 40;

        if (a + b > c && a + c > b && b + c > a) {
            let p = (a + b + c) / 2;
            let area = Math.pow(p * (p - a) * (p - b) * (p - c),0.5);
            alert("面积是：" + area);
        } else {
            alert("这不是三角形")
        }


    </script>
</body>
</html>